function ActionTreeConvert(rows) {
	function exists(rows, parentId) {
		for (var i = 0; i < rows.length; i++) {
			if (rows[i].id == parentId)
				return true;
		}
		return false;
	}
	var nodes = [];
	// 得到顶层节点
	for (var i = 0; i < rows.length; i++) {
		var row = rows[i];
		if (!exists(rows, row.parentId)) {
			nodes.push({
				id : row.id,
				text : row.text,
				iconCls:iconCls(row),
				attributes : row
			});
		}
	}
	var toDo = [];
	for (var i = 0; i < nodes.length; i++) {
		toDo.push(nodes[i]);
	}
	while (toDo.length) {
		var node = toDo.shift(); // 父节点 
		// 得到子节点 
		for (var i = 0; i < rows.length; i++) {
			var row = rows[i];
			if (row.parentId == node.id) {
				var child = {
					id : row.id,
					text : row.text,
					iconCls:iconCls(row),
					attributes : row
				};
				if (node.children) {
					node.children.push(child);
				} else {
					node.children = [child];
				}
				toDo.push(child);
			}
		}
	}
	return nodes;
}

function iconCls(row){
	//console.info(row);
	if(row.a_type==0){
		return "icon-aurl";
	}else if(row.a_type==1){
		return "icon-abtn";
	}else if(row.a_type==2){
		return "icon-amenu";
	}else if(row.a_type==3){
		return "icon-abox";
	}
}